<?php
session_start();

require_once 'LoginController.php';
require_once 'LoginHandler.php';
require_once '\Common\PageView.php';
require_once 'DBConfig.php';
require_once 'Database.php';
require_once 'RegisterView.php';
require_once 'RegisterController.php';require_once 'NavigationView.php';

class MasterController{
	
	public static function DoControll(){

		$navigationView = new NavigationView();
		$pageView = new Common\PageView();
		$pageView->StyleSheet('style.css');
		$db = new Database();
		
		$db->Connect(new DBConfig);
		
		
		if($navigationView->navRegister()){
			$registerController = new RegisterController();
			$controller = $registerController->DoControll($db);
			$body = $pageView->GetXHTML10StrictPage("Login", $controller);
		}
		else{
			$loginController = new LoginController();
			$controller = $loginController->DoControll($db);
			$body = $pageView->GetXHTML10StrictPage("Login", $controller);
		}
		
		return $body;
		
		$db->Close();

	}

}
echo MasterController::DoControll();


?>